@extends('admin.layout')
@section('content')
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                轮播图管理
                <small>列表</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 后台</a></li>
                <li><a href="#">轮播图管理</a></li>
                <li class="active">列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">快速查看轮播图列表</h3>
                        </div><!-- /.box-header -->
                                    
                       <div class='row'>
                       </div> 
                        <div class="box-body" >

                            @if(session('info'))
                         <div id='tishixiaoshi' class="alert alert-success alert-dismissable">
                             <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <h4>{{session('info')}}<i class="icon fa fa-check"></i> </h4>
                            @endif
                        </div>
                            <script type="text/javascript">
								window.onload = function()
								{
									$("#tishixiaoshi").hide(3000);
								}


							</script>	
                           
                            <table id="example2" class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th> ID</th>
                                    <th>商品名</th>
                                    <th>图片</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                           
                                   @foreach($data as $user)
                                <tr>
                                    <td>{{ $user -> id}}</td>
                                    <td class =''>{{ $user -> gname}}
                                    </td>
                                    <td><img src="{{$user -> limg}}" style="width:120px;height:80px;"> </td>
                                    <td> <a href="{{url('/admin/img/alter')}}/{{$user -> id}}"><button>编辑</button></a> 
                                         <a href="{{url('/admin/img/delete')}}/{{$user -> id}}"><button>删除</button></a>
                                    </td>
                                </tr>
                                 @endforeach
                            </table>
                           {!! $data -> appends($request) -> render() !!}
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
                        
@endsection